import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
	{
		path: '/home',
		name: 'home',
		redirect: '/index',
		component: () => import('@/views/Home.vue'),
		children: [
			{ // 首页
				path: '/index',
				name: 'index',
				component: () => import('@/views/Index.vue'),
				meta: { requireAuth: true }
			},
			{ //文章审核
				path: '/articleReview',
				name: 'articleReview',
				component: () => import('@/views/article/ArticleReview.vue'),
				meta: { requireAuth: true }
			},
			{ // 个人中心
				path: '/userInfo',
				name: 'userInfo',
				component: () => import('@/views/Sys/UserInfo.vue'),
				meta: { requireAuth: true }
			},
			{ // 个人中心
				path: '/SysDict',
				name: 'SysDict',
				component: () => import('@/views/Sys/SysDict.vue'),
				meta: { requireAuth: true }
			},
			{ // 个人中心
				path: '/SysData/:dictId(\\d+)',
				name: 'SysData',
				component: () => import('@/views/Sys/SysData.vue'),
				meta: { requireAuth: true }
			},
			{ // 创建群聊
				path: '/group/ToCreateGroup',
				name: 'ToCreateGroup',
				component: () => import('@/views/group/ToCreateGroup.vue'),
			},
			{ // 审核入群申请
				path: '/group/JoinGroupAudit',
				name: 'JoinGroupAudit',
				component: () => import('@/views/group/JoinGroupAudit.vue'),
			},
		]
	},
	{
		path: '/',
		name: 'login',
		component: () => import('@/views/Login.vue'),
	},
	
]

const router = new VueRouter({
	routes,

})

export default router
